USER_INFO_REPORT = {
    'real_time_report': False,
    'group_by': '_user_id',
    'target_event_id': ['user_data_sync', 'recharge', 'bet_order', 'active', 'withdraw'],
    'values': [
        {
            "value_id": "account_info",
            "target_value": "account_info",
            "value_name": "账户信息",
            "filter": [
                {"term": {"_event_id": "user_data_sync"}}
            ],
            "sort": [
                {"_event_time": {"order": "desc"}}
            ],
            "operation": "top_hits"
        },
        {
            "value_id": "recharge",
            "target_value": "recharge_price",
            "value_name": "当日充值",
            "filter": [
                {"term": {"_event_id": "recharge"}}
            ],
            "operation": "sum",
            "value_type": "float"
        },
        {
            "value_id": "withdraw",
            "target_value": "withdraw_real_price",
            "value_name": "当日提现",
            "filter": [
                {"term": {"_event_id": "withdraw"}}
            ],
            "operation": "sum",
            "value_type": "float"
        },
        {
            "value_id": "tax",
            "target_value": "bet_order_tax_amount",
            "value_name": "当日税收",
            "filter": [
                {"term": {"bet_order_user_type": 0}},
                {"term": {"_event_id": "bet_order"}}
            ],
            "operation": "sum",
            "value_type": "float"
        },
        {
            "value_id": "profit",
            "target_value": ["withdraw_real_price", "-", "recharge_price"],
            "value_name": "盈利金额",
            "filter": [
                {'terms': {'_event_id': ['recharge', 'withdraw']}},
            ],
            "value_type": "float",
            "adjust_amount": True
        },
        {
            "value_id": "last_active_at",
            "target_value": "_event_time",
            "value_name": "最后活跃时间",
            "filter": [],
            "operation": "max",
            "value_type": "long"
        }

    ]
}
